<template>
    <van-skeleton :row="5" v-if="status" />
    <div v-else>
        <van-nav-bar title="首页" />
        <van-tabs v-model:active="active">
            <van-tab title="推荐">
                <van-search v-model="value" placeholder="请输入搜索关键词" @click="dj"/>
                <van-swipe :autoplay="3000" lazy-render>
                    <van-swipe-item v-for="image in images" :key="image">
                        <img :src="image" style="width: 100%;height: 200px;" />
                    </van-swipe-item>
                </van-swipe>
                <van-grid>
                    <van-grid-item icon="photo-o" text="文字" />
                    <van-grid-item icon="photo-o" text="文字" />
                    <van-grid-item icon="photo-o" text="文字" />
                    <van-grid-item icon="photo-o" text="文字" />
                </van-grid>
                <van-card num="2" price="2.00" desc="描述信息" title="商品标题"
                    thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg" />
                <van-card num="2" price="2.00" desc="描述信息" title="商品标题"
                    thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg" />
                <van-card num="2" price="2.00" desc="描述信息" title="商品标题"
                    thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg" />
            </van-tab>
            <van-tab title="美食">内容 2</van-tab>
            <van-tab title="车库">内容 3</van-tab>
            <van-tab title="乐器">内容 4</van-tab>
        </van-tabs>
    </div>
</template>

<script setup>
const images = [
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-3.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-4.jpeg',
];
import { ref } from "vue";
import { catitemsApi, floordataApi } from "@/api/api";
import router from "@/router";
let catitems = ref([])
catitemsApi().then(res => {
    console.log('导航', res);
    catitems.value = res.data.message
})
let floordata = ref([])
floordataApi().then(res => {
    console.log('楼层', res);
    floordata.value = res.data.message
})
let dj=()=>{
    router.push('/ss')
}
</script>

<style lang="scss" scoped></style>